home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / assembly / coppers.lha / CopperDemo4.s < prev    next >
Encoding:
Text File  |  1980-01-01  |  5.5 KB  |  145 lines

  1. ; *** CLI-Copperdemo written by Gerson Kurz ***
  2. ;
  3. ; Size : 700 Bytes
  4. ;
  5. ; Hier ist ein Vollstaendig dokumentiertes Listing der CLI Copperliste.
  6. ; Mit diesem Wissen kann man bsp. eigene CLI Effekte leicht schreiben....
  7. ; Das Prg selbst hat eigentlich keinen Sinn, aber es zeigt was man so
  8. ; alles mit der Copperliste des CLIs anfangen kann. Es ist nicht ganz
  9. ; fehlerfrei (so schaltet es sich beispielsweise aus,wenn ein anderes
  10. ; Window angeklickt wird) aber man soll ja auch noch Platz zum
  11. ; Experimentieren haben...
  12. ; -----------------------------------------------------------
  13. ; Erstmal den Speicher & die gfx.lib oeffnen
  14. ; -----------------------------------------------------------
  15. o:    move.l    4,a6        ; Execbase in a6
  16.     jsr    -132(a6)    ; Execall FORBID
  17.     move.l    #$2000,d0    ; $2000 Bytes
  18.     moveq    #2,d1        ; ChipMEM
  19.     jsr    -$c6(a6)    ; ExecCall ALLOCMEM
  20.     move.l    d0,mem        ; Adresse retten
  21.     beq.l    fehler        ; Error ?
  22.     lea    gfxname,a1    ; gfx.library
  23.     jsr    -408(a6)    ; ExecCall OPENLIB
  24.     move.l    d0,gfxbase    ; Gfxbase retten
  25. ; -----------------------------------------------------------
  26. ; Jetzt kopieren wir einfach unsere Copperliste in die Adresse,
  27. ; die wir uns vorher hergeholt haben...
  28. ; -----------------------------------------------------------
  29. wait:    btst    #5,$dff01f    ; Blitter ready ?
  30.     beq.s    wait        ; nein, warten
  31.     lea    copperliste,a1     ; Zeiger auf UserCopperliste
  32.     move.l    mem,a0        ; Zeiger auf Speicher
  33. coloop:    move.l    (a1)+,d0    ; Adresse rueberkopieren
  34.     cmp.l    #$fffffffe,d0    ; Letztes Langwort erreicht ?
  35.     beq.s    excolp        ; Ja, dann kommt unser Einschub
  36.     move.l    d0,(a0)+    ; Langwort kopiern
  37.     bra.s    coloop        ; Weiter in der Schleife
  38. excolp:    move.w    #$3009,d0    ; Ab Zeile $3009
  39.     lea    coltab,a1    ; Zeiger auf unsere Farben
  40.     move.l    #250,d3
  41. main:    move.w    (a1)+,d1    ; Erste Farbe rueberkopieren
  42.     cmp.w    #$fffe,d1    ; Letzte Farbe erreicht ?
  43.     bne.s    doit        ; Nein, also weiter im Text
  44.     lea    coltab,a1    ; Sonst nochmal Farben initialisieren
  45.     move.w    (a1)+,d1    ; und nach d1 kopieren
  46. doit:    move.w    d0,(a0)+    ; Zeile in die Copperliste
  47.     move.w    #$fffe,(a0)+    ; Wait-Code in die Copperliste
  48.     move.w    #$0180,(a0)+    ; Zeiger auf Background Color
  49.     move.w    d1,(a0)+    ; Farbe in die Copperliste
  50.     move.w    #$0182,(a0)+    ; Zeiger auf Foreground-Color
  51.     move.w    #$fff,d2    ; Farbe Weiss nach d2
  52.     sub.w    d1,d2        ; Farbe d1 umdrehen
  53.     move.w    d2,(a0)+    ; Farbe in die Copperliste
  54.     add.w    #$0100,d0    ; Naechste Zeile 
  55.     cmp.w    #$ff09,d0    ; Ende ?
  56.     beq.s    initpal        ; Nein, also weiter
  57.     dbra    d3,main
  58.     bra.s    copend
  59. initpal:move.l    #$ffffffde,(a0)+
  60.     move.l    #$0009,d0
  61.     bra.s    main    
  62. copend:    lea    copperende,a1    ; Zeiger auf schluss der UserCopperliste
  63. coloop2:move.l    (a1)+,d0    ; Naechstes Langwort nach d0
  64.     move.l    d0,(a0)+    ; und in die Copperliste
  65.     cmp.l    #$fffffffe,d0    ; Ende erreicht ?
  66.     bne.s    coloop2        ; nein, also nochmal
  67. ; -----------------------------------------------------------
  68. ; Copperliste einschalten
  69. ; -----------------------------------------------------------
  70.     move.l    gfxbase(pc),a0    ; Zeiger auf gfxbase
  71.     adda.l    #$32,a0        ; Zeiger auf CLI Copperliste
  72.     move.w    #$0080,$dff096    ; DmaCon abstellen
  73.     move.l    (a0),a1        ; alte copperliste raushauen
  74.     move.l    mem,(a0)    ; Neue Copperliste reinhauen
  75.     move.w    #$8080,$dff096    ; und Dmacon wieder ein.
  76. ; -----------------------------------------------------------
  77. ; Und raus ins CLI !
  78. ; -----------------------------------------------------------
  79. exit:    move.l    4,a6        ; Execbase nach a6
  80.     move.l    gfxbase,a1    ; gfxbase nach a1
  81.     jsr    -414(a6)    ; ExecCall CLOSELIB
  82. fehler:    jsr    -138(a6)    ; ExecCall PERMIT
  83.     rts            ; Zurueck ins CLI
  84. ; -----------------------------------------------------------
  85. ; Labels....
  86. ; -----------------------------------------------------------
  87. gfxname:dc.b 'graphics.library',0
  88. even
  89. gfxbase:dc.l 0
  90. copperliste:
  91. dc.l $2b01fffe    ; Warte auf Zeile $2b01
  92. dc.l $01800000    ; Color00  
  93. dc.l $01820679    ; Color01
  94. dc.l $01840abc    ; Color02
  95. dc.l $01860345    ; Color03
  96. dc.l $01a00000    ; Color16
  97. dc.l $01a2079a    ; Color17
  98. dc.l $01a40467    ; Color18
  99. dc.l $01a60acd    ; Color19
  100. dc.l $01a80444    ; Color20
  101. dc.l $01aa0555    ; Color21    Alle diese Farbenwerte lassen sich vom User
  102. dc.l $01ac0666    ; Color22    Nach belieben einstellen
  103. dc.l $01ae0777    ; Color23
  104. dc.l $01b00888    ; Color24
  105. dc.l $01b20999    ; Color25
  106. dc.l $01b40aaa    ; Color26
  107. dc.l $01b60bbb    ; Color27
  108. dc.l $01b80ccc    ; Color28
  109. dc.l $01ba0ddd    ; Color29
  110. dc.l $01bc0eee    ; Color30
  111. dc.l $01be0fff    ; Color31
  112. dc.l $008e0581    ; Obere Linke Ecke des Screens
  113. dc.l $01000200    ; Keine Bitplanes
  114. dc.l $01040024    ; Prioritaet des Screens (!!!!)
  115. dc.l $009040c1    ; Untere Rechte Ecke des Screens
  116. dc.l $0092003c    ; Begin der Bitplane DMA
  117. dc.l $009400d0    ; Ende der Bitplane DMA
  118. dc.l $01020000    ; Keine Bitplaneverschiebung
  119. dc.l $01080000    ; Modulo auf 0 (ungerade Bitplanes)
  120. dc.l $010a0000    ; Module auf 0 (gerade Bitplanes)
  121. dc.l $00e00000    ; Adresse Bitplane 0 HI
  122. dc.l $00e2b4d0    ; Adresse Bitplane 0 LOW
  123. dc.l $00e40001  ; Adresse Bitplane 1 HI
  124. dc.l $00e604d0  ; Adresse Bitplane 1 LOW
  125. dc.l $2c01fffe  ; Warte auf $2c01
  126. dc.l $0100a200    ; Bitplanes fuer MedRes Einschalten
  127. dc.l $fffffffe    ; Code - nur fuer internen Gebrauch in diesem Listing...
  128. copperende:
  129. dc.l $ffdffffe    ; PAL ein
  130. dc.l $2c01fffe    ; Warten auf $2c01
  131. dc.l $01000200    ; Bitplanes loeschen
  132. dc.l $fffffffe    ; Ende der Copperliste
  133. mem: dc.l 0
  134. coltab:
  135. dc.w $000,$001,$002,$003,$004,$005,$006,$007,$008,$009,$00A
  136. DC.W $00B,$00C,$00D,$00E,$00F,$01F,$02F,$03F,$04F,$06F,$07F
  137. DC.W $08F,$09F,$0AF,$0BF,$0CF,$0DF,$0EF,$0FF,$0FE,$0FD,$0FC
  138. DC.W $0FA,$0FA,$0F9,$0F8,$0F7,$0F6,$0F5,$0F4,$0F3,$0F2,$0F1
  139. DC.W $0F0,$1F0,$2F0,$3F0,$4F0,$5F0,$6F0,$7F0,$8F0,$9F0,$AF0
  140. DC.W $BF0,$CF0,$DF0,$EF0,$FF0,$FE0,$FD0,$FC0,$FB0,$FA0,$F90
  141. DC.W $F80,$F70,$F60,$F50,$F40,$F30,$F20,$F10,$F00,$E00,$D00
  142. DC.W $C00,$B00,$A00,$900,$800,$700,$600,$500,$400,$300,$200
  143. DC.W $100
  144. dc.w $fffe
  145.